package com.aspire.boc.mms.gwcmp.action;


import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.aspire.boc.mms.gwcmp.dao.GwcmpCapClassMapper;
import com.aspire.boc.mms.gwcmp.model.GwcmpCapClass;
import com.aspire.boc.mms.gwcmp.model.GwcmpCapClassExample;
import com.aspire.boc.mms.gwcmp.util.GwcmpAdminUtil;

/**
 * 获取处理类
 * @author yuanpengpeng
 *
 */
@Controller
public class CommonAct {

	private static Log logger = LogFactory.getLog(CommonAct.class);

	@Autowired
	private GwcmpCapClassMapper gwcmpcapclassmapper;
	
	/**
	 * 获取处理类
	 * @param classType CAP处理类类型
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/common/getCapClasses")
	@ResponseBody
	public Map<String, Object> getCapClasses(
			HttpServletRequest request, HttpServletResponse response) {
		String operator = GwcmpAdminUtil.getLoginUserName(request);
		GwcmpCapClassExample gwcmpcapclassexample = new GwcmpCapClassExample();
		gwcmpcapclassexample.createCriteria();
		logger.info("operator: " + operator
				+ ",operation: query common /common/getCapClasses ");
		
		Map<String, Object> map = new HashMap<String, Object>();
		List<GwcmpCapClass> list = null;
		list = gwcmpcapclassmapper.selectByExample(gwcmpcapclassexample);
		logger.info("operator: " + operator
				+ ", operation: getCapClasses, result: list=" + list);

		map.put("list",list);
		return map;
	}

	
}
